<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'company.label', default: 'company')}"/>
    <title>新增公司</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>新增公司</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link action="index">公司列表</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">公司</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">
            <g:if test="${flash.message}">
                <div class="message alert alert-info" role="status">${flash.message}
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                            aria-hidden="true">×</span></button>
                </div>
            </g:if>
            <g:hasErrors bean="${this.company}">
                <ul class="errors" role="alert">
                    <g:eachError bean="${this.company}" var="error">
                        <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                            <g:message error="${error}"/>
                        </li>
                    </g:eachError>
                </ul>
            </g:hasErrors>
        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>公司</h5>

                    <div class="card-header-right">
                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <g:form action="save" class="form-horizontal">
                        <div class="form-group row">
                            <label class="col-md-2 control-label">公司</label>

                            <div class="col-md-3">
                                <g:textField class="form-control" name="name" id="name" value="${this.company?.name}"/>
                            </div>
                            <label class="col-md-2 control-label is-required">serialNumber</label>

                            <div class="col-md-3">
                                <g:textField class="form-control" name="serialNumber" id="serialNumber"
                                             value="${this.company?.serialNumber}"/>
                            </div>
                        </div>


                        <div class="form-group row">
                            <label class="col-md-2 control-label">logo</label>

                            <div class="col-md-3">
                                <g:textField class="form-control" name="logo" id="logo" value="${this.company?.logo}"/>
                            </div>
                            <label class="col-md-2 control-label">代码</label>

                            <div class="col-md-3">
                                <g:textField class="form-control" name="code" id="code" value="${this.company?.code}"/>
                            </div>

                        </div>


                        <div class="form-group row">

                            <label class="col-md-2 control-label">行业</label>

                            <div class="col-md-3">
                                <g:select class="form-control" name="industry"
                                          id="industry" optionValue="name" optionKey="id"
                                          from="${com.next.Industry.list()}"
                                          noSelection="${['': '请选择']}"/>
                            </div>
                            <label class="col-md-2 control-label is-required">最大Account数量</label>

                            <div class="col-md-3">
                                <g:field type="number" class="form-control" name="maximumNumberOfAccount"
                                         id="maximumNumberOfAccount"
                                         value="${this.company?.maximumNumberOfAccount}"/>
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>

                        <div class="form-group row">

                            <label class="col-md-2 control-label is-required">最大User数量</label>

                            <div class="col-md-3">
                                <g:field type="number" class="form-control" name="maximumNumberOfUser"
                                         id="maximumNumberOfUser"
                                         value="${this.company?.maximumNumberOfUser}"/>
                            </div>
                            %{-- <label class="col-md-2 control-label">enableTerritory</label>

                             <div class="col-md-3">
                                 <span class="cont">
                                     <g:checkBox class="i-checks" name="enableTerritory"
                                                 value="${this.company?.enableTerritory}"/>
                                 </span>
                             </div>--}%
                        </div>


                        <div class="form-group row">

                            <label class="col-md-3 control-label">enablePayroll</label>

                            <div class="col-md-2">
                                <div class="col-md-4 border-checkbox-section">
                                    <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                        <g:checkBox class="border-checkbox" name="enablePayroll" id="checkbox0"
                                                    value="${this.company?.enablePayroll}"/>
                                        <label class="border-checkbox-label" for="checkbox0"></label>
                                    </div>

                                </div>

                            </div>
                            <label class="col-md-3 control-label">enableCustomizedOpportunityStage</label>

                            <div class="col-md-2">
                                <div class="col-md-4 border-checkbox-section">
                                    <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                        <g:checkBox class="border-checkbox" name="enableCustomizedOpportunityStage"
                                                    id="checkbox1"
                                                    value="${this.company?.enableCustomizedOpportunityStage}"/>
                                        <label class="border-checkbox-label" for="checkbox1"></label>
                                    </div>

                                </div>

                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-md-3 control-label">开启商机工作流</label>
                            <div class="col-md-2">
                                <div class="col-md-4 border-checkbox-section">
                                    <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                        <g:checkBox class="border-checkbox" name="enableOpportunityWorkflow"
                                                    id="checkbox2"
                                                    value="${this.company?.enableOpportunityWorkflow}"/>
                                        <label class="border-checkbox-label" for="checkbox2"></label>
                                    </div>

                                </div>

                            </div>

                        </div>

                        <div class="form-group row">
                            <div class="col-md-12">
                                <g:submitButton class="btn btn-info" name="update" value="保存"/>
                            </div>
                        </div>
                    </g:form>

                </div>
            </div>
            <!-- Hover table card end -->
        </div>

        <!-- Page-body end -->

    </div>
</div>

</body>

</html>


